package com.qzw.security.web.exception;


import com.qzw.common.web.model.Result;
import com.qzw.common.web.util.ResultUtils;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.transaction.SystemException;

@ControllerAdvice(annotations = RestController.class)
@ResponseBody
public class SystemExceptionAdvice {

    @ExceptionHandler(SystemException.class)
    public Result systemException(SystemException e) {
        return ResultUtils.result(Result.Code.FAIL.getValue(), e.getMessage());
    }


}
